
import pandas as pd

def fun1():
    mydataset = {
        'sites':["Google", "Runoob", "Wiki"],
        'number': [1, 2, 3]
    }

    myvar = pd.DataFrame(mydataset)
    print(myvar)

def fun2():
    a = [1, 2, 3]
    myvar = pd.Series(a)
    print(myvar)

# 根据索引值读取数据
def fun3():
    a = [1, 2, 3]
    myvar = pd.Series(a)
    print(myvar[1])

# 指定索引值
def fun4():
    a = ["Google", "Runoob", "Wiki"]
    myvar = pd.Series(a, index=["x", "y", "z"])
    print(myvar)

# 根据索引值读取数据
def fun5():
    a = ["Google", "Runoob", "Wiki"]
    myvar = pd.Series(a, index=["x", "y", "z"])
    print(myvar["y"])

# 使用key/value对象
def fun6():
    sites = {1:"Google", 2:"Runoob", 3:"Wiki"}
    myvar = pd.Series(sites)
    print(myvar)

def fun7():
    sites = {1:"Google", 2:"Runoob", 3:"Wiki"}
    myvar = pd.Series(sites, index=[1, 3])
    print(myvar)

# 设置Series名称参数
def fun8():
    sites = {1:"Google", 2:"Runoob", 3:"Wiki"}
    myvar = pd.Series(sites, index=[1, 2], name="Python-Series-Test")
    print(myvar)

if __name__ == '__main__':
    fun8()